package com.youlu.campus.web.resumeI;

import com.youlu.campus.entity.UserResumeInfo;
import com.youlu.campus.service.resume.UserResumeInfoService;
import com.youlu.campus.web.common.base.RequestContext;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ResumeInfoController {
    @Autowired
    private UserResumeInfoService userResumeInfoService;

    /**
     * 获取简历
     *
     * @return
     */
    @GetMapping("/mini-app/resume")
    public QResult getResume() {

        return QResult.success(userResumeInfoService.get(RequestContext.getUserId()));

    }

    /**
     * 新建简历
     *
     * @return
     */
    @PostMapping("/mini-app/resume/create")
    public QResult createResume(@RequestBody UserResumeInfo req) {

        return QResult.success(userResumeInfoService.create(req));

    }

    /**
     * 修改简历
     *
     * @return
     */
    @PostMapping("/mini-app/resume/update")
    public QResult updateResume(@RequestBody UserResumeInfo req) {

        return QResult.success(userResumeInfoService.update(req));


    }
}
